<div id="content_area">
	<div id="content_left">
		<ul id="navigation">
			<li>Main Menu
				<ul>
					<li>Media
						<ul>
							<li><a href="/admin/content/media/dir/slider1">Slider 1</a></li>
							<li><a href="/admin/content/media/dir/slider2">Slider 2</a></li>
						</ul>
					</li>										
				</ul>		
			</li>
		</ul>
	</div>
	<div id="content_right">
		<div id="msgbox"><?php echo $this->msg; ?></div>
		<div id="loader"></div>
		<div class="clear"></div>
		<div id="dataviewer">
			<?php 
				foreach ($this->banner_arr as $banner) :
					$file_icon = "<img src='/" . $this->image_path . "/" . $banner['banner_filename'] . "' width='100' height='65' />";
					if($banner['is_active'] == 1)
					{
						$status_icon = "publish.png";
					} else {
						$status_icon = "publish_x.png";
					}
					
					// file_icon - change the folder icon if $dir is image
					$toolbar = "<a href='/admin/content/media/dir/" . $this->banner_dir . "/task/edit/id/" . $banner['banner_id'] . "'><img src='/images/admin/edit.gif' width='15' height='15' title='edit' /></a>&nbsp;&nbsp;&nbsp;<a href='/admin/content/media/dir/" . $this->banner_dir . "/task/delete/id/" . $banner['banner_id'] . "' ><img src='/images/admin/disable.gif' width='15' height='15' title='delete' /></a>&nbsp;&nbsp;&nbsp;<a href='javascript: void(0);' onclick='changeBannerStatus(" . $banner['banner_id'] . ")'><img src='/images/admin/" . $status_icon . "' width='16' height='16' title='unpublish'  /></a>";
					
	            	$list_dirs = "<div style='float: left; padding: 0 15px 0 0;'>" . $file_icon . "<br /><p class='txt_size11' style='text-align: center;'>" . $banner['banner_filename'] . "</p><p style='text-align: center;'>" . $toolbar . "</p></div>";
		            if($banner['banner_filename'] != "")
		            {
		            	echo "<a href='javascript: void(0);' onclick='showBannerDir(\"" . $banner . "\")'>" . $list_dirs . "</a>";				
		            } else {		            	
		            	echo "<div style='float: left; padding: 0 15px 0 0;'><img src='/images/admin/no_photo.jpg' /><p style='text-align: center;'>" . $toolbar . "</p></div>";				
		            }
				endforeach;
			?>
		</div>
		<?php
			if($this->task == "edit")
			{
				$btn_val = "Edit " . ucfirst($this->banner_dir);
			} else {
				$btn_val = "Add " . ucfirst($this->banner_dir);
			}
			
		?>
		<div id="upload_form">
			<form name="frmBanner" method="POST" action="/admin/content/uploader/dir/<?php echo $this->banner_dir; ?>" enctype="multipart/form-data">
				<p>Upload Form</p><p class="small_hint">Upload files (Maximum Size: 10 MB)</p>
				<p><?php echo $this->image_path; ?></p>
				<div class="form_label">Title</div>
				<div class="form_element" style="margin: 0 0 0 45px;"><input type="text" name="txtBannerTitle" id="txtBannerTitle" value="<?php echo $this->banner_result_arr['banner_title']; ?>" style="width: 300px;" /></div>
				<div class="clear"></div>
				<div class="form_label">Description</div>
				<div class="form_element">
					<?php echo $this->editorFCK("txtBannerDesc", $this->banner_result_arr['banner_desc'], 600, 250); ?>
				</div>
				<div class="clear"></div>
				<div class="form_label">URL</div>
				<div class="form_element" style="margin: 0 0 10px 45px;"><input type="text" name="txtBannerURL" id="txtBannerURL" value="<?php echo $this->banner_result_arr['banner_url']; ?>" style="width: 300px;" /></div>
				<div class="clear"></div>
				<div class="form_label">Is Active</div>
				<div class="form_element" style="margin: 0 0 10px 20px;"><input type="checkbox" name="txtIsActive" id="txtIsActive" value="<?php echo($this->banner_result_arr['is_active'] == "")?1:0; ?>" <?php echo($this->banner_result_arr['is_active'] == 1)?"checked":""; ?> /></div>
				<div class="clear"></div>
				<div class="form_label">Filename</div>
				<div class="form_element" style="margin: 0 0 10px 24px;"><input type="file" name="bannerimage" id="bannerimage" size="20" /></div>
				<div class="clear"></div>
				<div class="form_element" style="margin: 0 0 10px 100px;">
				<input type="submit" name="btnUpload" id="btnUpload" value="<?php echo $btn_val;?>" class="button" />
				<input type="reset" id="" value="Clear Form" class="button" />
				<input type="hidden" name="txtBannerId" id="txtBannerId" value="<?php echo $this->banner_id; ?>" />
				<input type="hidden" name="txtBannerImg" id="txtBannerImg" value="<?php echo $this->banner_result_arr['banner_filename']; ?>" />
				<input type="hidden" name="txtDir" id="txtDir" value="<?php echo $this->banner_dir; ?>" />
				</div>
			</form>
		</div>
	</div>
</div>